﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using RXY_Mall.Domain;

namespace RXY_Mall.AdminApi.Models
{
    #region 银行卡

    public class AddBankCardInput : BaseInput
    {
        /// <summary>
        /// 持卡人
        /// </summary>
        [Required(ErrorMessage = "持卡人不能为空！")]
        public string account_holder { get; set; }
        /// <summary>
        /// 银行卡号
        /// </summary>
        [Required(ErrorMessage = "银行卡号不能为空！")]
        [RegularExpression(@"^([1-9]{1})(\d{14}|\d{15}|\d{18})$", ErrorMessage = "银行卡号格式不正确")]
        public string card_no { get; set; }
        /// <summary>
        /// 开户行
        /// </summary>
        [Required(ErrorMessage = "开户行不能为空！")]
        public string bank_name { get; set; }
        /// <summary>
        /// 开户地区(用英文逗号隔开)
        /// </summary>
        [Required(ErrorMessage = "开户地区不能为空！")]
        public string bank_address { get; set; }
        /// <summary>
        /// 开户支行
        /// </summary>
        [Required(ErrorMessage = "开户支行不能为空！")]
        public string bank_branch { get; set; }
        /// <summary>
        /// 手机号
        /// </summary>
        [Required(ErrorMessage = "手机号不能为空！")]
        public string mobile { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string remark { get; set; }
    }

    /// <summary>
    /// 银行卡删除类
    /// </summary>
    public class DeleteBankCardInput : BaseInput
    {
        /// <summary>
        /// 银行卡ID
        /// </summary>
        public int bank_card_id { get; set; }
    }

    /// <summary>
    /// 银行卡
    /// </summary>
    public class BankCardOutput
    {
        public int bank_card_id { get; set; }
        /// <summary>
        /// 持卡人
        /// </summary>
        public string account_holder { get; set; }
        /// <summary>
        /// 卡号
        /// </summary>
        public string card_no { get; set; }
        /// <summary>
        /// 开户行
        /// </summary>
        public string bank_name { get; set; }
        /// <summary>
        /// 地址
        /// </summary>
        public string bank_address { get; set; }
        /// <summary>
        /// 开户支行
        /// </summary>
        public string bank_branch { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string remark { get; set; }
    }

    #endregion


    /// <summary>
    /// 交易记录
    /// </summary>
    public class GetTradeLogsOutput
    {
        internal DateTime add_time;
        internal decimal last_value;
        internal decimal value;
        internal int _trade_type;

        /// <summary>
        /// 订单号
        /// </summary>
        public string order_no { get; set; }
        /// <summary>
        /// 币种
        /// </summary>
        public Currencies currency { get; internal set; }
        /// <summary>
        /// 交易类型
        /// </summary>
        public string trade_type { get; set; }
        /// <summary>
        /// 交易金额
        /// </summary>
        public string trade_value { get; set; }
        /// <summary>
        /// 剩余余额
        /// </summary>
        public string remain_value { get; set; }
        /// <summary>
        /// 添加时间
        /// </summary>
        public long trade_time { get; set; }
        /// <summary>
        /// 收支类型
        /// </summary>
        public PaymentType type { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string remark { get; set; }

    }


    #region 红包
    public class RedpacketListOutput
    {

    }

    #endregion

    #region 提现
    /// <summary>
    /// 添加提现输入信息
    /// </summary>
    public class AddWithdrawInput : BaseInput
    {
        /// <summary>
        /// 银行卡ID
        /// </summary>
        public int bank_card_id { get; set; }
        /// <summary>
        /// 提现金额
        /// </summary>
        [Required]
        public decimal money { get; set; }
        /// <summary>
        /// 支付密码
        /// </summary>
        public string pay_password { get; set; }
    }

    /// <summary>
    /// 提现记录
    /// </summary>
    public class GetWithdrawListOutput
    {
        internal DateTime add_time;
        internal DateTime? update_time;

        /// <summary>
        /// 提现ID
        /// </summary>
        public int withdraw_id { get; set; }
        /// <summary>
        /// 银行
        /// </summary>
        public string bank_name { get; set; }
        /// <summary>
        /// 银行卡号
        /// </summary>
        public string card_no { get; set; }
        /// <summary>
        /// 开户支行
        /// </summary>
        public string bank_branch { get; set; }
        /// <summary>
        /// 银行地址
        /// </summary>
        public string bank_address { get; set; }
        /// <summary>
        /// 提现金额
        /// </summary>
        public decimal money { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string remark { get; set; }
        /// <summary>
        /// 服务费
        /// </summary>
        public decimal service_fee { get; set; }
        /// <summary>
        /// 实际金额
        /// </summary>
        public decimal amount { get; set; }
        /// <summary>
        /// 真实姓名
        /// </summary>
        public string account_holder { get; set; }
        /// <summary>
        /// 提现申请时间
        /// </summary>
        public long withdraw_time { get; internal set; }
        /// <summary>
        /// 提现到账或失败时间
        /// </summary>
        public long complete_time { get; internal set; }
        /// <summary>
        /// 状态(1申请中 2已处理 3驳回)
        /// </summary>
        public byte status { get; set; }
        /// <summary>
        /// 拒绝理由
        /// </summary>
        public string dismiss_reason { get; set; }

    }
    #endregion

    #region 红包
    /// <summary>
    /// 红包信息输出信息
    /// </summary>
    public class GetRedpacketInfoOutput
    {
        /// <summary>
        /// 红包数
        /// </summary>
        public int redpacket_count { get; set; }
        /// <summary>
        /// 交易额
        /// </summary>
        public string trade_volume { get; set; }
    }

    /// <summary>
    /// 获得红包列表输出信息
    /// </summary>
    public class GetRedpacketOutput
    {
        internal string nick_name;
        internal DateTime expire_time;

        internal DateTime add_time { get; set; }
        internal DateTime? acquire_time { get; set; }
        /// <summary>
        /// 红包ID
        /// </summary>
        public int redpacket_id { get; set; }
        /// <summary>
        /// 用户名
        /// </summary>
        public string user_name { get; set; }
        /// <summary>
        /// 用户头像
        /// </summary>
        public string user_logo { get; set; }
        /// <summary>
        /// 红包类型
        /// </summary>
        public RedpacketType redpacket_type { get; set; }
        /// <summary>
        /// 红包描述
        /// </summary>
        public string remark { get; set; }
        /// <summary>
        /// 领取红包时间
        /// </summary>
        public long acquire_red_time { get; set; }
        /// <summary>
        /// 是否领取红包
        /// </summary>
        public bool is_acquire { get; internal set; }
        /// <summary>
        /// 红包金额
        /// </summary>
        public decimal value { get; internal set; }
        /// <summary>
        /// 红包过期时间
        /// </summary>
        public long expire_red_time { get; internal set; }
        /// <summary>
        /// 红包添加时间
        /// </summary>
        public long add_red_time { get; internal set; }
        /// <summary>
        /// 总周期
        /// </summary>
        public int? total_cycle { get; internal set; }
    }

    /// <summary>
    /// 领取红包
    /// </summary>
    public class AcquireRedpacketInput : BaseInput
    {
        public int redpacket_id { get; set; }
    }

    #endregion

    #region 补贴卡

    /// <summary>
    /// 获得补贴卡列表输出信息
    /// </summary>
    public class GetSubsidyListOutput
    {
        internal DateTime? acquire_time { get; set; }
        /// <summary>
        /// 红包ID
        /// </summary>
        public int redpacket_id { get; set; }
        /// <summary>
        /// 领取时间或补贴时间
        /// </summary>
        public long acquire_subsidytime { get; set; }
        /// <summary>
        /// 是否领取
        /// </summary>
        public bool is_acquire { get; internal set; }
        /// <summary>
        /// 补贴金额
        /// </summary>
        public decimal amount { get; internal set; }       
        /// <summary>
        /// 总期数
        /// </summary>
        public int total_cycle { get; set; }
        /// <summary>
        /// 剩余期数
        /// </summary>
        public int remain_cycle { get; set; }
    }

    /// <summary>
    /// 补贴卡详情输出信息
    /// </summary>
    public class GetSubsidyOutput : GetSubsidyListOutput
    {
        public List<SubsidyItem> items { get; set; }
    }

    public class SubsidyItem
    {
        internal DateTime add_time;

        public long date { get; set; }
        public decimal value { get; set; }
        public int month { get; internal set; }
    }


    /// <summary>
    /// 领取红包
    /// </summary>
    public class AcquireSubsidyInput : BaseInput
    {
        public int subsidy_id { get; set; }
    }
    #endregion

    #region 团队业绩
    /// <summary>
    /// 团队业绩输出信息
    /// </summary>
    public class GetChildInfoOutput
    {
        /// <summary>
        /// 徒弟数
        /// </summary>
        public int child_count { get; set; }
        /// <summary>
        /// 交易额
        /// </summary>
        public string trade_volume { get; set; }
    }

    /// <summary>
    /// 获得红包列表输出信息
    /// </summary>
    public class GetChildTradeLogsOutput
    {
        internal string nick_name;

        internal DateTime add_time { get; set; }       
        /// <summary>
        /// 用户名
        /// </summary>
        public string user_name { get; set; }
        /// <summary>
        /// 用户头像
        /// </summary>
        public string user_logo { get; set; }        
        /// <summary>
        /// 金额
        /// </summary>
        public decimal amount { get; internal set; }     
        /// <summary>
        /// 交易时间
        /// </summary>
        public long trade_add_time { get; internal set; }
    }


    /// <summary>
    /// 用户信息
    /// </summary>
    public class GetUserTradeOutput
    {
        internal decimal value;
        internal DateTime add_time;

        /// <summary>
        /// 用户ID
        /// </summary>
        internal int user_id { get; set; }
        /// <summary>
        /// 用户名
        /// </summary>
        public string user_name { get; set; }
        /// <summary>
        /// 头像
        /// </summary>
        public string logo { get; set; }
        /// <summary>
        /// 交易金额
        /// </summary>
        public string amount { get; set; }
        /// <summary>
        /// 交易时间
        /// </summary>
        public long trade_time { get; set; }
    }

    /// <summary>
    /// 
    /// </summary>
    public class GetPerformanceByMemberNameOutput
    {
        /// <summary>
        /// 用户ID
        /// </summary>
        public int userId { get; set; }
        /// <summary>
        /// 用户名
        /// </summary>
        public string userName { get; set; }
        /// <summary>
        /// 头像
        /// </summary>
        public string logo { get; set; }
        /// <summary>
        /// 充值总量
        /// </summary>
        public string rechargeAmount { get; set; }
        /// <summary>
        /// 充值数量
        /// </summary>
        public string rechargeCount { get; set; }
    }

    #endregion


}